package com.imweibokong.platform.convertor;

import weibo4j.DirectMessage;

import com.imweibokong.platform.dataobject.WeiBoMessage;

public class WeiBoMessageConvertor {

    public static WeiBoMessage fromSinaMessage(DirectMessage sinaMsg) {
        WeiBoMessage msg = new WeiBoMessage();

        msg.setId(sinaMsg.getId());
        msg.setText(sinaMsg.getText());
        msg.setSenderId(sinaMsg.getSenderId());
        msg.setSenderScreenName(sinaMsg.getSenderScreenName());

        msg.setRecipientId(sinaMsg.getRecipientId());
        msg.setRecipientScreenName(sinaMsg.getRecipientScreenName());

        msg.setCreatedTime(sinaMsg.getCreatedAt());

        msg.setMsgType("sina");

        return msg;
    }
}
